<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Jframe Manual</title>
<!-- 2017-02-22 Wed 14:39 -->
<meta  http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta  name="generator" content="Org-mode" />
<meta  name="author" content="dzh" />
<style type="text/css">
 <!--/*--><![CDATA[/*><!--*/
  .title  { text-align: center; }
  .todo   { font-family: monospace; color: red; }
  .done   { color: green; }
  .tag    { background-color: #eee; font-family: monospace;
            padding: 2px; font-size: 80%; font-weight: normal; }
  .timestamp { color: #bebebe; }
  .timestamp-kwd { color: #5f9ea0; }
  .right  { margin-left: auto; margin-right: 0px;  text-align: right; }
  .left   { margin-left: 0px;  margin-right: auto; text-align: left; }
  .center { margin-left: auto; margin-right: auto; text-align: center; }
  .underline { text-decoration: underline; }
  #postamble p, #preamble p { font-size: 90%; margin: .2em; }
  p.verse { margin-left: 3%; }
  pre {
    border: 1px solid #ccc;
    box-shadow: 3px 3px 3px #eee;
    padding: 8pt;
    font-family: monospace;
    overflow: auto;
    margin: 1.2em;
  }
  pre.src {
    position: relative;
    overflow: visible;
    padding-top: 1.2em;
  }
  pre.src:before {
    display: none;
    position: absolute;
    background-color: white;
    top: -10px;
    right: 10px;
    padding: 3px;
    border: 1px solid black;
  }
  pre.src:hover:before { display: inline;}
  pre.src-sh:before    { content: 'sh'; }
  pre.src-bash:before  { content: 'sh'; }
  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
  pre.src-R:before     { content: 'R'; }
  pre.src-perl:before  { content: 'Perl'; }
  pre.src-java:before  { content: 'Java'; }
  pre.src-sql:before   { content: 'SQL'; }

  table { border-collapse:collapse; }
  caption.t-above { caption-side: top; }
  caption.t-bottom { caption-side: bottom; }
  td, th { vertical-align:top;  }
  th.right  { text-align: center;  }
  th.left   { text-align: center;   }
  th.center { text-align: center; }
  td.right  { text-align: right;  }
  td.left   { text-align: left;   }
  td.center { text-align: center; }
  dt { font-weight: bold; }
  .footpara:nth-child(2) { display: inline; }
  .footpara { display: block; }
  .footdef  { margin-bottom: 1em; }
  .figure { padding: 1em; }
  .figure p { text-align: center; }
  .inlinetask {
    padding: 10px;
    border: 2px solid gray;
    margin: 10px;
    background: #ffffcc;
  }
  #org-div-home-and-up
   { text-align: right; font-size: 70%; white-space: nowrap; }
  textarea { overflow-x: auto; }
  .linenr { font-size: smaller }
  .code-highlighted { background-color: #ffff00; }
  .org-info-js_info-navigation { border-style: none; }
  #org-info-js_console-label
    { font-size: 10px; font-weight: bold; white-space: nowrap; }
  .org-info-js_search-highlight
    { background-color: #ffff00; color: #000000; font-weight: bold; }
  /*]]>*/-->
</style>
<script type="text/javascript">
/*
@licstart  The following is the entire license notice for the
JavaScript code in this tag.

Copyright (C) 2012-2013 Free Software Foundation, Inc.

The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version.  The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.

As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.


@licend  The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
 function CodeHighlightOn(elem, id)
 {
   var target = document.getElementById(id);
   if(null != target) {
     elem.cacheClassElem = elem.className;
     elem.cacheClassTarget = target.className;
     target.className = "code-highlighted";
     elem.className   = "code-highlighted";
   }
 }
 function CodeHighlightOff(elem, id)
 {
   var target = document.getElementById(id);
   if(elem.cacheClassElem)
     elem.className = elem.cacheClassElem;
   if(elem.cacheClassTarget)
     target.className = elem.cacheClassTarget;
 }
/*]]>*///-->
</script>
</head>
<body>
<div id="content">
<h1 class="title">Jframe Manual</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1. 工程目录</a>
<ul>
<li><a href="#sec-1-1">1.1. 下载地址</a></li>
<li><a href="#sec-1-2">1.2. 工程说明</a>
<ul>
<li><a href="#sec-1-2-1">1.2.1. 项目checkout目录结构</a></li>
<li><a href="#sec-1-2-2">1.2.2. <span class="todo TODO">TODO</span> Maven说明</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#sec-2">2. 安装/使用</a>
<ul>
<li><a href="#sec-2-1">2.1. 运行环境</a></li>
<li><a href="#sec-2-2">2.2. 构建启动</a></li>
</ul>
</li>
<li><a href="#sec-3">3. 框架配置</a>
<ul>
<li><a href="#sec-3-1">3.1. 启动脚本</a></li>
<li><a href="#sec-3-2">3.2. 框架日志</a></li>
<li><a href="#sec-3-3">3.3. config.properties</a></li>
<li><a href="#sec-3-4">3.4. vmargs[-win]</a></li>
</ul>
</li>
<li><a href="#sec-4">4. Jframe</a>
<ul>
<li><a href="#sec-4-1">4.1. jframe-launcher</a>
<ul>
<li><a href="#sec-4-1-1">4.1.1. 启动过程</a></li>
<li><a href="#sec-4-1-2">4.1.2. </a></li>
<li><a href="#sec-4-1-3">4.1.3. jframe.launcher.api</a></li>
<li><a href="#sec-4-1-4">4.1.4. use launcher</a></li>
</ul>
</li>
<li><a href="#sec-4-2">4.2. jframe-core</a>
<ul>
<li><a href="#sec-4-2-1">4.2.1. jframe状态机</a></li>
<li><a href="#sec-4-2-2">4.2.2. UnitManager</a></li>
<li><a href="#sec-4-2-3">4.2.3. PluginClassloader</a></li>
<li><a href="#sec-4-2-4">4.2.4. </a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#sec-5">5. Plugin</a>
<ul>
<li><a href="#sec-5-1">5.1. 插件示例</a></li>
<li><a href="#sec-5-2">5.2. 开发插件</a>
<ul>
<li><a href="#sec-5-2-1">5.2.1. 定义插件类</a></li>
<li><a href="#sec-5-2-2">5.2.2. 插件配置文件 - plugin.properties</a></li>
</ul>
</li>
<li><a href="#sec-5-3">5.3. 插件使用技巧</a>
<ul>
<li><a href="#sec-5-3-1">5.3.1. 插件间交互~Policy</a></li>
<li><a href="#sec-5-3-2">5.3.2. 插件间交互~Message</a></li>
<li><a href="#sec-5-3-3">5.3.3. 插件间交互~Service</a></li>
<li><a href="#sec-5-3-4">5.3.4. Policy vs Message vs Service</a></li>
<li><a href="#sec-5-3-5">5.3.5. 获取配置更新</a></li>
</ul>
</li>
<li><a href="#sec-5-4">5.4. 插件注解说明</a>
<ul>
<li><a href="#sec-5-4-1">5.4.1. 插件相关</a></li>
<li><a href="#sec-5-4-2">5.4.2. 服务相关</a></li>
<li><a href="#sec-5-4-3">5.4.3. 注入</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#sec-6">6. 调试/性能</a>
<ul>
<li><a href="#sec-6-1">6.1. 远程调试</a>
<ul>
<li><a href="#sec-6-1-1">6.1.1. 调试守护进程(Main)</a></li>
<li><a href="#sec-6-1-2">6.1.2. 调试框架进程(FrameMain)</a></li>
</ul>
</li>
<li><a href="#sec-6-2">6.2. 本地调试</a>
<ul>
<li><a href="#sec-6-2-1">6.2.1. 在Eclipse中调式jframe项目</a></li>
</ul>
</li>
<li><a href="#sec-6-3">6.3. 使用jvisualvm</a></li>
</ul>
</li>
<li><a href="#sec-7">7. 核心插件</a>
<ul>
<li><a href="#sec-7-1">7.1. jframe-watch</a>
<ul>
<li><a href="#sec-7-1-1">7.1.1. 功能</a></li>
<li><a href="#sec-7-1-2">7.1.2. 配置</a></li>
</ul>
</li>
<li><a href="#sec-7-2">7.2. jframe-upg</a></li>
<li><a href="#sec-7-3">7.3. jframe-rcp</a></li>
</ul>
</li>
<li><a href="#sec-8">8. 高级主题</a>
<ul>
<li><a href="#sec-8-1">8.1. 管理jframe</a></li>
<li><a href="#sec-8-2">8.2. 扩展jframe</a></li>
</ul>
</li>
<li><a href="#sec-9">9. 源码分析</a>
<ul>
<li><a href="#sec-9-1">9.1. 启动/关闭</a></li>
<li><a href="#sec-9-2">9.2. 加载插件</a></li>
<li><a href="#sec-9-3">9.3. 消息分发</a>
<ul>
<li><a href="#sec-9-3-1">9.3.1. 进程内分发</a></li>
<li><a href="#sec-9-3-2">9.3.2. 队列分发</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>

<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> 工程目录</h2>
<div class="outline-text-2" id="text-1">
</div><div id="outline-container-sec-1-1" class="outline-3">
<h3 id="sec-1-1"><span class="section-number-3">1.1</span> 下载地址</h3>
<div class="outline-text-3" id="text-1-1">
<p>
git clone <a href="https://github.com/dzh/jframe.git">https://github.com/dzh/jframe.git</a>
</p>
</div>
</div>
<div id="outline-container-sec-1-2" class="outline-3">
<h3 id="sec-1-2"><span class="section-number-3">1.2</span> 工程说明</h3>
<div class="outline-text-3" id="text-1-2">
</div><div id="outline-container-sec-1-2-1" class="outline-4">
<h4 id="sec-1-2-1"><span class="section-number-4">1.2.1</span> 项目checkout目录结构</h4>
<div class="outline-text-4" id="text-1-2-1">
<p>
<i>注: 以下结构可能与实际稍不同</i>
</p>
<pre class="example">
- jframe                            #checkout目录
  - doc                             #项目文档
  - jframe                          #jframe框架根目录，注意在eclipse里选择它install,不要在下面的module项目上install
    - backup                        #存放一些文件，用户备份
    - jframe-core                   #框架核心
    - jframe-example-plugin         #演示插件编写的示例插件
    - jframe-ext                    #jframe-core的扩展
    - jframe-launcher               #启动Main函数
    - jframe-release                #install构建的jframe结构，一定要在jframe根目录install
      - jframe                      #这个目录之下，代表了jframe框架的程序结构布局
        - bin                       #启动、停止脚本
        - conf                      #配置文件，包括config.properties、vmargs、logback.xml等
        - doc                       #文档  
        - lib                       #公共lib库,动态dll|so默认目录,由系统类加载器加载
        - log                       #默认日志输出目录
        - plugin                    #默认插件目录,下面的插件有插件类加载器加载
        - temp                      #默认临时目录,如存放进程pid文件等
        - update                    #默认系统更新目录,upg更新插件使用
    - jframe-swt                    #jframe的swt插件实现,这个示例还没做好,目前演示了将jframe用于C端的方式
    - jframe-watch                  #资源更新插件,跟踪配置文件的修改并通知其他插件
  - jframe-plugin                   #jframe实现的一些插件
</pre>
</div>
</div>
<div id="outline-container-sec-1-2-2" class="outline-4">
<h4 id="sec-1-2-2"><span class="section-number-4">1.2.2</span> <span class="todo TODO">TODO</span> Maven说明</h4>
<div class="outline-text-4" id="text-1-2-2">
<ul class="org-ul">
<li>jframe项目使用eclipse+maven开发和管理
</li>
<li>在eclipse里通过在jframe和jframe-plugins上install后，将直接构建最后的发布格式
<ul class="org-ul">
<li>如jframe构建后的jframe-release即所有使用jframe框架应用程序的一般目录布局（可以通过config.properties定制）
</li>
<li>jframe-plugins构建说明
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>

<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> 安装/使用</h2>
<div class="outline-text-2" id="text-2">
</div><div id="outline-container-sec-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> 运行环境</h3>
<div class="outline-text-3" id="text-2-1">
<ul class="org-ul">
<li>oracle jdk1.5以上
</li>
<li>支持linux、windows
</li>
<li>Eclipse+Maven插件+git插件
</li>
</ul>
</div>
</div>
<div id="outline-container-sec-2-2" class="outline-3">
<h3 id="sec-2-2"><span class="section-number-3">2.2</span> 构建启动</h3>
<div class="outline-text-3" id="text-2-2">
<ul class="org-ul">
<li>将clone到本地目录里的jframe项目导入到eclipse里
</li>
</ul>

<div class="figure">
<p><img src="../doc/images/eclipse-jframe-structure.jpeg" alt="eclipse-jframe-structure.jpeg" />
</p>
<p><span class="figure-number">Figure 1:</span> Eclipse里jframe框架项目结构</p>
</div>
<ul class="org-ul">
<li>在项目'jframe'上右键
</li>
</ul>
</div>
</div>
</div>

<div id="outline-container-sec-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> 框架配置</h2>
<div class="outline-text-2" id="text-3">
</div><div id="outline-container-sec-3-1" class="outline-3">
<h3 id="sec-3-1"><span class="section-number-3">3.1</span> 启动脚本</h3>
</div>
<div id="outline-container-sec-3-2" class="outline-3">
<h3 id="sec-3-2"><span class="section-number-3">3.2</span> 框架日志</h3>
</div>
<div id="outline-container-sec-3-3" class="outline-3">
<h3 id="sec-3-3"><span class="section-number-3">3.3</span> config.properties</h3>
</div>
<div id="outline-container-sec-3-4" class="outline-3">
<h3 id="sec-3-4"><span class="section-number-3">3.4</span> vmargs[-win]</h3>
</div>
</div>

<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Jframe</h2>
<div class="outline-text-2" id="text-4">
</div><div id="outline-container-sec-4-1" class="outline-3">
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> jframe-launcher</h3>
<div class="outline-text-3" id="text-4-1">
</div><div id="outline-container-sec-4-1-1" class="outline-4">
<h4 id="sec-4-1-1"><span class="section-number-4">4.1.1</span> 启动过程</h4>
<div class="outline-text-4" id="text-4-1-1">
<ul class="org-ul">
<li>Main 守护进程main函数
</li>
<li>FrameMain
</li>
</ul>
</div>
</div>
<div id="outline-container-sec-4-1-2" class="outline-4">
<h4 id="sec-4-1-2"><span class="section-number-4">4.1.2</span> </h4>
<div class="outline-text-4" id="text-4-1-2">
<ul class="org-ul">
<li>v1.2.0版本开始功能, 和jframe-core的依赖关系倒置
</li>
<li>设计目标让launcher
</li>
</ul>
</div>
</div>
<div id="outline-container-sec-4-1-3" class="outline-4">
<h4 id="sec-4-1-3"><span class="section-number-4">4.1.3</span> jframe.launcher.api</h4>
</div>
<div id="outline-container-sec-4-1-4" class="outline-4">
<h4 id="sec-4-1-4"><span class="section-number-4">4.1.4</span> use launcher</h4>
</div>
</div>
<div id="outline-container-sec-4-2" class="outline-3">
<h3 id="sec-4-2"><span class="section-number-3">4.2</span> jframe-core</h3>
<div class="outline-text-3" id="text-4-2">
</div><div id="outline-container-sec-4-2-1" class="outline-4">
<h4 id="sec-4-2-1"><span class="section-number-4">4.2.1</span> jframe状态机</h4>
</div>
<div id="outline-container-sec-4-2-2" class="outline-4">
<h4 id="sec-4-2-2"><span class="section-number-4">4.2.2</span> UnitManager</h4>
<div class="outline-text-4" id="text-4-2-2">
</div><ol class="org-ol"><li><a id="sec-4-2-2-1" name="sec-4-2-2-1"></a>signal<br  /></li></ol>
</div>
<div id="outline-container-sec-4-2-3" class="outline-4">
<h4 id="sec-4-2-3"><span class="section-number-4">4.2.3</span> PluginClassloader</h4>
<div class="outline-text-4" id="text-4-2-3">
</div><ol class="org-ol"><li><a id="sec-4-2-3-1" name="sec-4-2-3-1"></a>类加载过程<br  /></li></ol>
</div>
<div id="outline-container-sec-4-2-4" class="outline-4">
<h4 id="sec-4-2-4"><span class="section-number-4">4.2.4</span> </h4>
</div>
</div>
</div>


<div id="outline-container-sec-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> Plugin</h2>
<div class="outline-text-2" id="text-5">
</div><div id="outline-container-sec-5-1" class="outline-3">
<h3 id="sec-5-1"><span class="section-number-3">5.1</span> 插件示例</h3>
</div>
<div id="outline-container-sec-5-2" class="outline-3">
<h3 id="sec-5-2"><span class="section-number-3">5.2</span> 开发插件</h3>
<div class="outline-text-3" id="text-5-2">
</div><div id="outline-container-sec-5-2-1" class="outline-4">
<h4 id="sec-5-2-1"><span class="section-number-4">5.2.1</span> 定义插件类</h4>
</div>

<div id="outline-container-sec-5-2-2" class="outline-4">
<h4 id="sec-5-2-2"><span class="section-number-4">5.2.2</span> 插件配置文件 - plugin.properties</h4>
</div>
</div>

<div id="outline-container-sec-5-3" class="outline-3">
<h3 id="sec-5-3"><span class="section-number-3">5.3</span> 插件使用技巧</h3>
<div class="outline-text-3" id="text-5-3">
</div><div id="outline-container-sec-5-3-1" class="outline-4">
<h4 id="sec-5-3-1"><span class="section-number-4">5.3.1</span> 插件间交互~Policy</h4>
</div>

<div id="outline-container-sec-5-3-2" class="outline-4">
<h4 id="sec-5-3-2"><span class="section-number-4">5.3.2</span> 插件间交互~Message</h4>
<div class="outline-text-4" id="text-5-3-2">
<ul class="org-ul">
<li>消息说明
<ul class="org-ul">
<li>所有实现jframe.core.msg.Msg的类都可以作为插件间交流的消息 继承PluginMsg实现自己的Msg 常用TextMsg
</li>
<li>Msg结构
<ul class="org-ul">
<li>type int 消息类型 插件根据type读取自己感兴趣的Msg
</li>
<li>meta 存储辅助数据 可以视为一个map数据结构
</li>
<li>value 消息内容 可选 可以用meta方式
</li>
</ul>
</li>
</ul>
</li>
<li>发送消息
<ul class="org-ul">
<li>Plugin必须继承自PluginSender或PluginSenderRecver
</li>
<li>plugin.send(Msg&lt;?&gt; msg) 发送消息
</li>
</ul>
<p>
/注: 插件里的类都可以使用@InjectPlugin将插件实体注入 /
</p>
</li>
<li>接收消息
<ul class="org-ul">
<li>Plugin必须继承自PluginRecver或PluginSenderRecver
</li>
<li>订阅感兴趣的消息
<ul class="org-ul">
<li>Plugin注解@Message(msgTypes = {MsgType}) 
</li>
<li>重写interestMsg(Msg&lt;?&gt; msg) 若返回true标示接收这个消息 
</li>
</ul>
<p>
/注: 使用注解方式时, 注意@Message的其他选项设置和父类注解内容保持一致 /
</p>
</li>
<li>plugin.doRecvMsg(Msg&lt;?&gt; msg) 接收消息
</li>
</ul>
</li>
<li>总结
</li>
</ul>
<p>
Message机制实现异步调度, 解藕系统部件间的依赖, 实现可插拔的灵活功能调度 
</p>
</div>
</div>

<div id="outline-container-sec-5-3-3" class="outline-4">
<h4 id="sec-5-3-3"><span class="section-number-4">5.3.3</span> 插件间交互~Service</h4>
<div class="outline-text-4" id="text-5-3-3">
<ul class="org-ul">
<li>插件服务特性说明
<ul class="org-ul">
<li>插件服务不依赖于插件启动次序
</li>
<li>服务是单例的
</li>
<li>插件卸载时, 定义在插件里的服务也将卸载, 并清除已注入的服务实例
</li>
<li>服务是基于接口的同步注入编程模型，方便插件间模块交互
</li>
</ul>
</li>
<li>定义插件服务
<ul class="org-ul">
<li>编写服务接口 通过注解定义服务，@Service(id='服务唯一ID',clazz='服务实现类') 
</li>
<li>编写服务实现类 接口和实现目前要求在同一个插件内
</li>
<li>定义服务 plugin.properties里`Plugin-Service`，服务间用空格分隔(默认作为Export-Class导出)
</li>
</ul>
</li>
<li>使用插件服务
<ul class="org-ul">
<li>导入服务接口 plugin.properties里`Import-Class`，服务间用空格分隔
</li>
<li>注入服务 @InjectService(id='服务唯一ID')，使用服务的类必须加@Injector
</li>
</ul>
</li>
<li>总结
</li>
</ul>
<p>
Service机制实现同步调度, 
</p>
<ul class="org-ul">
<li>示例插件服务
</li>
</ul>
<pre class="example">
</pre>
</div>
</div>


<div id="outline-container-sec-5-3-4" class="outline-4">
<h4 id="sec-5-3-4"><span class="section-number-4">5.3.4</span> Policy vs Message vs Service</h4>
<div class="outline-text-4" id="text-5-3-4">
<ul class="org-ul">
<li>Policy 消息共享
</li>
<li>Message 异步编程 
</li>
<li>Service 同步编程
</li>
</ul>
</div>
</div>

<div id="outline-container-sec-5-3-5" class="outline-4">
<h4 id="sec-5-3-5"><span class="section-number-4">5.3.5</span> 获取配置更新</h4>
</div>
</div>



<div id="outline-container-sec-5-4" class="outline-3">
<h3 id="sec-5-4"><span class="section-number-3">5.4</span> 插件注解说明</h3>
<div class="outline-text-3" id="text-5-4">
</div><div id="outline-container-sec-5-4-1" class="outline-4">
<h4 id="sec-5-4-1"><span class="section-number-4">5.4.1</span> 插件相关</h4>
<div class="outline-text-4" id="text-5-4-1">
<ul class="org-ul">
<li>@Plugin 插件配置
</li>
<li>@Message 插件消息配置
</li>
</ul>
</div>
</div>

<div id="outline-container-sec-5-4-2" class="outline-4">
<h4 id="sec-5-4-2"><span class="section-number-4">5.4.2</span> 服务相关</h4>
<div class="outline-text-4" id="text-5-4-2">
<ul class="org-ul">
<li>@Service 定义插件
</li>
<li>@Start   服务实例初始化启动
</li>
<li>@Stop    服务示例卸载时执行
</li>
</ul>
</div>
</div>
<div id="outline-container-sec-5-4-3" class="outline-4">
<h4 id="sec-5-4-3"><span class="section-number-4">5.4.3</span> 注入</h4>
<div class="outline-text-4" id="text-5-4-3">
<ul class="org-ul">
<li>@Injector 说明类使用注入功能，类没有这个注解的则下面的注解无效
</li>
<li>@InjectPlugin  注入插件实例
</li>
<li>@InjectService 注入服务
</li>
</ul>
</div>
</div>
</div>
</div>




<div id="outline-container-sec-6" class="outline-2">
<h2 id="sec-6"><span class="section-number-2">6</span> 调试/性能</h2>
<div class="outline-text-2" id="text-6">
</div><div id="outline-container-sec-6-1" class="outline-3">
<h3 id="sec-6-1"><span class="section-number-3">6.1</span> 远程调试</h3>
<div class="outline-text-3" id="text-6-1">
</div><div id="outline-container-sec-6-1-1" class="outline-4">
<h4 id="sec-6-1-1"><span class="section-number-4">6.1.1</span> 调试守护进程(Main)</h4>
</div>

<div id="outline-container-sec-6-1-2" class="outline-4">
<h4 id="sec-6-1-2"><span class="section-number-4">6.1.2</span> 调试框架进程(FrameMain)</h4>
<div class="outline-text-4" id="text-6-1-2">
<ul class="org-ul">
<li>conf/vmargs或vmargs-win文件中，开启jvm远程调试
</li>
</ul>
<p>
#+START<sub>EXAMPLE</sub> 
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt<sub>socket</sub>,address=6666,server=y,suspend=n
server＝y jvm作为调试服务端
suspend=n jvm启动后直接运行，若y则jvm启动后挂起，在调试客户端连接后才继续执行
address=6666 jvm调试服务端监听端口6666
#+END<sub>EXAMPLE</sub>
</p>
<ul class="org-ul">
<li>eclipse配置远程调试(以上面的配置为例)
</li>
</ul>

<div class="figure">
<p><img src="./images/eclipse-jframe-debug-remote.jpeg" alt="eclipse-jframe-debug-remote.jpeg" />
</p>
</div>
</div>
</div>
</div>


<div id="outline-container-sec-6-2" class="outline-3">
<h3 id="sec-6-2"><span class="section-number-3">6.2</span> 本地调试</h3>
<div class="outline-text-3" id="text-6-2">
</div><div id="outline-container-sec-6-2-1" class="outline-4">
<h4 id="sec-6-2-1"><span class="section-number-4">6.2.1</span> 在Eclipse中调式jframe项目</h4>
<div class="outline-text-4" id="text-6-2-1">
<p>
<i>注: 以下说明以jframe/jframe-demo工程为例</i>
</p>
<ul class="org-ul">
<li>思路
<ul class="org-ul">
<li>MainLauncher行为是读取配置文件启动Frame进程
</li>
<li>通过eclipse调式配置，直接启动FrameLauncher
</li>
</ul>
</li>
<li>构建工程，如cd jframe-demo | mvn install， 打包目录在jframe-demo/demo-release
</li>
<li>配置Eclipse Debug选项，如jframe-demo-debug
<ul class="org-ul">
<li>Main选项,配置启动Main函数
</li>
</ul>

<div class="figure">
<p><img src="./images/debug-local-tab-main.png" alt="debug-local-tab-main.png" width="600" />
</p>
</div>
<ul class="org-ul">
<li>Arguments选项, 主要配置3项: app.home应用根目录,launcher默认FrameLauncher,logback.configurationFile日志文件(可选,示例使用logback)
</li>
</ul>

<div class="figure">
<p><img src="./images/debug-local-tab-argu.png" alt="debug-local-tab-argu.png" width="600" />
</p>
</div>
<ul class="org-ul">
<li>Classpath选项, 在User Entries里加入构建时项目依赖的jar，如示例demo-release/lib/*.jar
</li>
</ul>

<div class="figure">
<p><img src="./images/debug-local-tab-path.png" alt="debug-local-tab-path.png" width="600" />
</p>
</div>
<ul class="org-ul">
<li>Source添加调式项目源码
</li>
</ul>

<div class="figure">
<p><img src="./images/debug-local-tab-source.png" alt="debug-local-tab-source.png" width="600" />
</p>
</div>
</li>
<li>上述配置配好，点击debug按钮，控制台会有日志输出，在源码中需要的地方设置断点就可以。
</li>
</ul>
</div>
</div>
</div>



<div id="outline-container-sec-6-3" class="outline-3">
<h3 id="sec-6-3"><span class="section-number-3">6.3</span> 使用jvisualvm</h3>
<div class="outline-text-3" id="text-6-3">
<ul class="org-ul">
<li>性能监控配置
</li>
</ul>
</div>
</div>
</div>


<div id="outline-container-sec-7" class="outline-2">
<h2 id="sec-7"><span class="section-number-2">7</span> 核心插件</h2>
<div class="outline-text-2" id="text-7">
</div><div id="outline-container-sec-7-1" class="outline-3">
<h3 id="sec-7-1"><span class="section-number-3">7.1</span> jframe-watch</h3>
<div class="outline-text-3" id="text-7-1">
</div><div id="outline-container-sec-7-1-1" class="outline-4">
<h4 id="sec-7-1-1"><span class="section-number-4">7.1.1</span> 功能</h4>
</div>
<div id="outline-container-sec-7-1-2" class="outline-4">
<h4 id="sec-7-1-2"><span class="section-number-4">7.1.2</span> 配置</h4>
</div>
</div>

<div id="outline-container-sec-7-2" class="outline-3">
<h3 id="sec-7-2"><span class="section-number-3">7.2</span> jframe-upg</h3>
</div>

<div id="outline-container-sec-7-3" class="outline-3">
<h3 id="sec-7-3"><span class="section-number-3">7.3</span> jframe-rcp</h3>
</div>
</div>

<div id="outline-container-sec-8" class="outline-2">
<h2 id="sec-8"><span class="section-number-2">8</span> 高级主题</h2>
<div class="outline-text-2" id="text-8">
</div><div id="outline-container-sec-8-1" class="outline-3">
<h3 id="sec-8-1"><span class="section-number-3">8.1</span> 管理jframe</h3>
</div>

<div id="outline-container-sec-8-2" class="outline-3">
<h3 id="sec-8-2"><span class="section-number-3">8.2</span> 扩展jframe</h3>
</div>
</div>

<div id="outline-container-sec-9" class="outline-2">
<h2 id="sec-9"><span class="section-number-2">9</span> 源码分析</h2>
<div class="outline-text-2" id="text-9">
</div><div id="outline-container-sec-9-1" class="outline-3">
<h3 id="sec-9-1"><span class="section-number-3">9.1</span> 启动/关闭</h3>
</div>
<div id="outline-container-sec-9-2" class="outline-3">
<h3 id="sec-9-2"><span class="section-number-3">9.2</span> 加载插件</h3>
</div>

<div id="outline-container-sec-9-3" class="outline-3">
<h3 id="sec-9-3"><span class="section-number-3">9.3</span> 消息分发</h3>
<div class="outline-text-3" id="text-9-3">
</div><div id="outline-container-sec-9-3-1" class="outline-4">
<h4 id="sec-9-3-1"><span class="section-number-4">9.3.1</span> 进程内分发</h4>
<div class="outline-text-4" id="text-9-3-1">
<p>
jframe.core.dispatch.DefDispatcher
</p>
</div>
</div>
<div id="outline-container-sec-9-3-2" class="outline-4">
<h4 id="sec-9-3-2"><span class="section-number-4">9.3.2</span> 队列分发</h4>
<div class="outline-text-4" id="text-9-3-2">
<p>
jframe.ext.dispatch.ActivemqDispatcher
</p>
<ul class="org-ul">
<li></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: dzh</p>
<p class="date">Created: 2017-02-22 Wed 14:39</p>
<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.4.1 (<a href="http://orgmode.org">Org</a> mode 8.2.10)</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
</html>
